<template>
	<view class="u-content">
		<u-parse :html="content"></u-parse>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: ''
			};
		},
		onLoad({
			id,
			title
		}) {

			this.getAgree(id)
			uni.setNavigationBarTitle({
				title: title || '协议'
			})
		},
		methods: {
			getAgree(type) {
				this.$u.api.getAgreeMent({
					id: type
				}).then((res) => {
					this.content = res.data
				}).catch(() => {
					this.content = ''
				})
			},
		}
	}
</script>

<style>
	.u-content {
		padding: 32rpx;
	}
</style>